﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SanctusSoftware.Logging.WSUpload
{
    public class UploadChunkEventArgs : EventArgs
    {

        public UploadChunkEventArgs(int chunkNumber, int totalNumberOfChunks)
        {
            ChunkNumber = chunkNumber;
            TotalNumberOfChunks = totalNumberOfChunks;
        }

        public int ChunkNumber { get; private set; }
        public int TotalNumberOfChunks { get; private set; }
        public int Percent
        {
            get
            {
                if (TotalNumberOfChunks == 0)
                {
                    return 0;
                }
                else
                {
                    return Convert.ToInt32(((Convert.ToDecimal(ChunkNumber) / Convert.ToDecimal(TotalNumberOfChunks) * 100M)));
                }
            }
        }


    }
}
